package com.xjy.headfirst.工厂模式;

/**
 * decription:
 *
 * @author 辛纪元
 * @since 2022-06-23
 */

public class NYPizzaStore extends PizzaStore{

    @Override
    protected Pizza createPizza(int type) {
        PizzaIngredientFactory nyPizzaIngredientFactory = new NYPizzaIngredientFactory();
        if (type == 1){
            CheesePizza cheesePizza = new CheesePizza(nyPizzaIngredientFactory);
            cheesePizza.setName("cheese");
            return cheesePizza;
        }

        return null;
    }
}
